<html>
<title>涨停表现</title>
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/fupan_css.css') }}" />
<script src="{{ url_for('static',filename='js/jquery-2.1.1.min.js') }}"></script>
<script src="{{ url_for('static',filename='js/show_message.js') }}"></script>
<script src="{{ url_for('static',filename='js/update.js') }}"></script>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">

<link href="./static/css/calendar.css" rel="stylesheet">
<link href="./static/kpl/com.css" rel="stylesheet">
<link href="./static/kpl/fChart.css" rel="stylesheet">
<link href="./static/kpl/mpage.css" rel="stylesheet">
<script src="./static/kpl/jquery.js"></script>
<script src="./static/kpl/com.js"></script>
<!--分时-->
<script src="./static/kpl/floatMChart.js"></script>
<!--K线-->
<script src="./static/kpl/floatKChart.js"></script>
<script src="./static/kpl/fChart.js"></script>

<body>
    <div class="table-one" style="float:left;">
        <div class="table-one" style="float:left;">
            <div>
                <div style="float:left;">
                    <label for="meeting">选择日期：</label>
                </div>

                <div style="float:left;">
                    <div class="to_left" onclick="οnclick_to_left()"></div>

                </div>
                <div style="float:left;">
                    <input id="meeting" type="date" onchange="upperCase(this.id)" />
                </div>

                <div style="float:left;">
                    <div class="to_right" onclick="οnclick_to_right()"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="table-one" style="float:left;width:100%;height:100%;">
        <div class="table-one" style="float:left;width:250px;height:100%;overflow:auto;">
            <table id="limit1" cellspacing="0"></table>
        </div>
        <div class="table-one" style="float:left;width:20px;height:100%;overflow:auto;">
        </div>
        <div class="table-one" style="float:left;width:344px;height:100%;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit2" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:70%;overflow:auto;">
                <table id="limit22" cellspacing="0"></table>
            </div>
        </div>
        <div class="table-one" style="float:left;width:20px;height:100%;overflow:auto;">
        </div>
        <div class="table-one" style="float:left;width:344px;height:100%;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit3" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit33" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="history33" cellspacing="0"></table>
            </div>
        </div>
        <div class="table-one" style="float:left;width:20px;height:100%;overflow:auto;">
        </div>
        <div class="table-one" style="float:left;width:344px;height:100%;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit4" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit44" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="history44" cellspacing="0"></table>
            </div>
        </div>
        <div class="table-one" style="float:left;width:20px;height:100%;overflow:auto;">
        </div>
        <div class="table-one" style="float:left;width:344px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit5" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit55" cellspacing="0"></table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="history" cellspacing="0"></table>
            </div>

        </div>

        <div class="table-one" style="float:left;width:344px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:100%;overflow:auto;">
                <table id="broke" cellspacing="0"></table>
            </div>
        </div>
        <div class="table-one" style="float:left;width:20px;height:100%;overflow:auto;">
        </div>
        <div class="table-one" style="float:left;width:344px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:100%;overflow:auto;">
                <table id="broke-history" cellspacing="0"></table>
            </div>
        </div>
        <div class="table-one" style="float:left;width:20px;height:100%;overflow:auto;">
        </div>
        <div class="table-one" style="float:left;width:344px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:100%;overflow:auto;">
                <table id="history-all-four" cellspacing="0"></table>
            </div>
        </div>
    </div>
</body>


<!-- 回调函数 -->
<script type="text/javascript">
    function history_all_four(data) {
        var stocks55_ = new Array()
        stocks55 = stocks55_
        for (i = 0; i < data['data'].length; i++) {
            stocks55.push(data['data'][i][0])
        }
        if (stocks55.length > 0) {
            return { 'stock': stocks55, 'data': data }
            // get_rise_data_update(stocks55, data, 'history-all-four', '历史未涨停的四板及以上个股')
        }
    }
    function history_55(data) {
        var stocks55_ = new Array()
        stocks55 = stocks55_
        for (i = 0; i < data['data'].length; i++) {
            stocks55.push(data['data'][i][0])
        }
        if (stocks55.length > 0) {
            get_rise_data_update(stocks55, data, 'history', '历史未涨停的四板个股')
        }else{
            set_table2_history(data, 'history', '历史未涨停的四板个股', null)
        }
    }

    function history_44(data) {
        var stocks44_ = new Array()
        stocks44 = stocks44_
        for (i = 0; i < data['data'].length; i++) {
            stocks44.push(data['data'][i][0])
        }
        if (stocks44.length > 0) {
            get_rise_data_update(stocks44, data, 'history44', '历史未涨停的三板个股')
        }else{
            set_table2_history(data, 'history44', '历史未涨停的三板个股', null)
        }
    }

    function history_33(data) {
        var stocks33_ = new Array()
        stocks33 = stocks33_
        for (i = 0; i < data['data'].length; i++) {
            stocks33.push(data['data'][i][0])
        }
        if (stocks33.length > 0) {
        get_rise_data_update(stocks33, data, 'history33', '历史未涨停的二板个股')
        }else{
            set_table2_history(data, 'history33', '历史未涨停的二板个股', null)
        }
    }

    // 历史炸板
    function history_broke(data) {
        var stocks = new Array()
        for (i = 0; i < data['data']['list'].length; i++) {
            stocks.push(data['data']['list'][i][0])
        }
        // if (stocks33.length > 0) {
        get_rise_data_update_broke_history(stocks, { 'data': data['data']['list'] }, 'broke-history', '昨日炸板个股')
        // }
    }
</script>

<!-- 日期事件 -->
<script type="text/javascript">
    // 左箭头回调函数
    function οnclick_to_left() {
        dates = document.getElementById("meeting").value
        console.log(dates);
        data = get_history_date()['data']//获取历史日期
        _indexof = data.indexOf(dates, 0) - 1 //匹配索引
        document.getElementById("meeting").value = data[_indexof] //设置日期
        show_form(data[_indexof])
        _indexof = _indexof - 1
        _stocks55 = get_limit2_data_history('fourBoardStocksYesterdayHistory', data[_indexof], 'history', '历史未涨停的四板个股', history_55)
        _stocks44 = get_limit2_data_history('threeBoardStocksYesterdayHistory', data[_indexof], 'history44', '历史未涨停的三板个股', history_44)
        _stocks33 = get_limit2_data_history('twoBoardStocksYesterdayHistory', data[_indexof], 'history33', '历史未涨停的二板个股', history_33)
        get_limit2_data_history('limit_broke_history', data[_indexof], 'broke-history', '昨日炸板个股', history_broke)
    }

    // 右箭头回调函数
    function οnclick_to_right() {
        dates = document.getElementById("meeting").value
        console.log(dates);
        data = get_history_date()['data']//获取历史日期
        _indexof = data.indexOf(dates, 0) + 1 //匹配索引
        document.getElementById("meeting").value = data[_indexof] //设置日期
        show_form(data[_indexof])
        _stocks55 = get_limit2_data_history('fourBoardStocksYesterdayHistory', data[_indexof-1], 'history', '历史未涨停的四板个股', history_55)
        _stocks44 = get_limit2_data_history('threeBoardStocksYesterdayHistory', data[_indexof-1], 'history44', '历史未涨停的三板个股', history_44)
        _stocks33 = get_limit2_data_history('twoBoardStocksYesterdayHistory', data[_indexof-1], 'history33', '历史未涨停的二板个股', history_33)
        get_limit2_data_history('limit_broke_history', data[_indexof-1], 'broke-history', '昨日炸板个股', history_broke)
    }

    // 获取历史日期
    function get_history_date() {
        var m_data = []
        $.ajax({
            url: '/get_history_date',
            // data: {data: codes},
            type: 'POST',
            async: false, //异步加载
            dataType: 'json',
            // contentType: 'application/json; charset=UTF-8',
            success: function (data) {
                m_data = data;
                console.log(data);
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    function show_form(date) {//date 日期
        get_limit1_data('oneStocksHistory', date, 'limit1', '一板')
        get_limit1_data('oneStocksYesterdayHistory', date, 'limit2', '二板')
        get_limit2_data('oneBoardStocksYesterdayHistory', date, 'limit22', '未涨停的昨日一板个股')
        get_limit1_data('twoStocksYesterdayHistory', date, 'limit3', '三板')
        get_limit2_data('twoBoardStocksYesterdayHistory', date, 'limit33', '未涨停的昨日二板个股')
        get_limit1_data('threeStocksYesterdayHistory', date, 'limit4', '四板')
        get_limit2_data('threeBoardStocksYesterdayHistory', date, 'limit44', '未涨停的昨日三板个股')
        get_limit1_data('fourStocksYesterdayHistory', date, 'limit5', '更高')
        get_limit2_data('fourBoardStocksYesterdayHistory', date, 'limit55', '未涨停的昨日四板及以上个股')
    }

    function upperCase(x) {
        clearInterval(ID_THREAD)
        var dates = document.getElementById(x).value //获取选择的日期
        show_form(dates)
        data = get_history_date()['data']
        _indexof = data.indexOf(dates, 0) - 1
        _stocks55 = get_limit2_data_history('fourBoardStocksYesterdayHistory', data[_indexof], 'history', '历史未涨停的四板个股', history_55)
        _stocks44 = get_limit2_data_history('threeBoardStocksYesterdayHistory', data[_indexof], 'history44', '历史未涨停的三板个股', history_44)
        _stocks33 = get_limit2_data_history('twoBoardStocksYesterdayHistory', data[_indexof], 'history33', '历史未涨停的二板个股', history_33)
        get_limit2_data_history('limit_broke_history', data[_indexof], 'broke-history', '昨日炸板个股', history_broke)
    }

    //获取历史未涨停的四板及以上个股
    function date_all_four(fun) {
        for (var i = 1; i < 22; i++) {
            _data = get_limit2_data_history_async('fourBoardStocksYesterdayHistory', dates[dates.length - i])
            if (_data.length > 0) {
                if (_data['data'].length > 0) {
                    __data = history_all_four(_data)
                    stock = stock.concat(__data['stock'])
                    data_all_four = data_all_four.concat(__data['data']['data'])
                }
            }
        }
        fun(data_all_four)
    }

    function get_stocks() {
        for (var i = 1; i < 60; i++) {
            _data = get_limit2_data_history('fourBoardStocksYesterdayHistory', dates[dates.length - i], '', '', get_stocks_callback)
            if (_data.length > 0) {
                if (_data['data'].length > 0) {
                    __data = history_all_four(_data)
                    stock = stock.concat(__data['stock'])
                    data_all_four = data_all_four.concat(__data['data']['data'])
                }
            }
        }
    }

    function get_stocks_callback(data) {
        if (data['data'].length > 0) {
            _data = history_all_four(data)
            stock = stock.concat(_data['stock'])
            data_all_four = data_all_four.concat(_data['data']['data'])
        }
        update_all_four_from(data_all_four)
    }

    function update_all_four_from(data) {
        get_rise_data_update(stock, { 'data': data }, 'history-all-four', '历史未涨停的四板及以上个股')
    }

</script>

<script type="text/javascript">
    var ID_THREAD = -1; //循环线程
    var all_theme = []; //题材数组
    var stocks55, stocks44, stocks33 = new Array();
    var stock = [], data_all_four = [];

    $(document).ready(function () {
        onload();
    });

    // $(document).on("pageshow",function(){
    //     onload();
    // });
    //加载页面
    function onload() {
        dates = _history_date_eastmoney()

        //获取现在日期
        var date = new Date();
        const formatDate = (date) => {
            let formatted_date = date.getFullYear() + "-" + checkDay((date.getMonth() + 1)) + "-" + checkDay(date.getDate())
            return formatted_date;
        }
        console.log(formatDate(date));
        document.getElementById("meeting").value = dates[dates.length - 1] //设置日期

        get_stocks()
        ID_THREAD = auto_update(run)
    }
    function run() {
        get_limit1_data('get_daily_limit_performance', '1', 'limit1', '一板')
        get_limit1_data('get_daily_limit_performance', '2', 'limit2', '二板')
        get_limit2_data('get_daily_limit_performance2', '2', 'limit22', '未涨停的昨日一板个股')
        get_limit1_data('threePlate', '2', 'limit3', '三板')
        get_limit2_data('twoBoardStocksYesterday', '2', 'limit33', '未涨停的昨日二板个股')
        get_limit1_data('fourPlate', '2', 'limit4', '四板')
        get_limit2_data('threeBoardStocksYesterday', '2', 'limit44', '未涨停的昨日三板个股')
        get_limit1_data('fivePlate', '2', 'limit5', '更高')
        get_limit2_data('fourBoardStocksYesterday', '2', 'limit55', '未涨停的昨日四板个股')

        get_limit2_data_history('fourBoardStocksYesterdayHistory', dates[dates.length - 1], 'history', '历史未涨停的四板个股', history_55)
        get_limit2_data_history('threeBoardStocksYesterdayHistory', dates[dates.length - 1], 'history44', '历史未涨停的三板个股', history_44)
        get_limit2_data_history('twoBoardStocksYesterdayHistory', dates[dates.length - 1], 'history33', '历史未涨停的二板个股', history_33)
        get_limit2_data_history('limit_broke_history', dates[dates.length - 1], 'broke-history', '昨日炸板个股', history_broke)

        get_rise_data_update(stock, { 'data': data_all_four }, 'history-all-four', '历史未涨停的四板及以上个股')
        get_broke()//炸板
        // get_broke_history(dates[dates.length - 1])//炸板

    }

    // 获取股票涨幅数据并更新表格
    function get_rise_data_update(codes, _data, id, caption) {
        var m_data = []
        $.ajax({
            url: '/codes_rise',
            data: JSON.stringify({
                data: codes
            }),
            type: 'POST',
            async: true, //异步加载
            dataType: 'json',
            contentType: 'application/json; charset=UTF-8',
            success: function (data) {
                m_data = data;
                console.log(data);
                set_table2_history(_data, id, caption, data)
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    // 获取股票涨幅数据并更新表格
    function get_rise_data_update_broke_history(codes, _data, id, caption) {
        var m_data = []
        $.ajax({
            url: '/codes_rise',
            data: JSON.stringify({
                data: codes
            }),
            type: 'POST',
            async: true, //异步加载
            dataType: 'json',
            contentType: 'application/json; charset=UTF-8',
            success: function (data) {
                m_data = data;
                console.log(data);
                set_table_broke_history(_data, id, caption, data)
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    // 获取一板涨停数据
    function get_limit1_data(fun, limit, id, caption) {
        var m_data = []
        $.ajax({
            url: '/' + fun,
            data: { 'data': limit },
            type: 'POST',
            async: true, //异步加载
            dataType: 'json',
            success: function (data) {
                m_data = data
                set_table1(data, id, caption)
                // set_option()
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    // 获取昨日涨停今日未涨停数据
    function get_limit2_data(fun, limit, id, caption) {
        var m_data = []
        $.ajax({
            url: '/' + fun,
            data: { 'data': limit },
            type: 'POST',
            async: true, //异步加载
            dataType: 'json',
            success: function (data) {
                m_data = data
                set_table2(data, id, caption)
                // set_option()
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    // 获取历史昨日涨停今日未涨停数据
    function get_limit2_data_history(fun, limit, id, caption, callback) {
        var m_data = []
        $.ajax({
            url: '/' + fun,
            data: { 'data': limit },
            type: 'POST',
            async: true, //异步加载
            dataType: 'json',
            success: function (data) {
                m_data = data
                callback(data);
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    // 获取历史昨日涨停今日未涨停数据同步加载
    function get_limit2_data_history_async(fun, limit) {
        var m_data = []
        $.ajax({
            url: '/' + fun,
            data: { 'data': limit },
            type: 'POST',
            async: false, //同步加载
            dataType: 'json',
            success: function (data) {
                m_data = data
                // callback(data);
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    // 获取炸板数据
    function get_broke() {
        var m_data = []
        $.ajax({
            url: '/limit_broke',
            data: {},
            type: 'POST',
            async: true,
            dataType: 'json',
            success: function (data) {
                // m_data = data
                set_table_broke(data['data']['list'])
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        // return m_data;
    };

    // 获取历史炸板数据
    function get_broke_history(date) {
        var m_data = []
        $.ajax({
            url: '/limit_broke_history',
            data: { 'data': date },
            type: 'POST',
            async: true,
            dataType: 'json',
            success: function (data) {
                // m_data = data
                set_table_broke_history(data['data']['list'])
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        // return m_data;
    };

    function set_table1(data, id, caption) {
        all_theme = [];
        var m_html = ""
        var m_th = "<tr class=\"cur\">\
            <th style=\"width:68px\">股票名称</th>\
            <th style=\"width:58px\">涨停时间</th>\
            <th style=\"width:28px\">状态</th>\
            <th style=\"width:68px\">涨停原因</th>\
            </tr>"
        // <th>板块</th>\
        // <th>最大封单</th>\
        // <th>封单</th>\
        // <th>主力净额</th>\
        // <th>成交额</th>\
        // <th>实际换手</th>\
        // <th>实际流通</th>\

        var m_list = data['data']
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else
                m_html += "<tr class=\"cur\">"
            if (m_list[i_row][16] == 1) {
                m_html += "<td class=\"gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            } else {
                m_html += "<td class=\"td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>"
            }
            m_html += "<td>" + format_date(new Date(parseInt(m_list[i_row][4]) * 1000)) + "</td>"
            //     //数据统计
            // all_theme = all_theme.concat({
            //     name: m_list[i_row][5],
            //     value: 1
            // })
            m_html += "<td>" + m_list[i_row][15] + "</td>"
            m_html += "<td>" + m_list[i_row][5] + "</td>"
            // m_html += "<td>" + m_list[i_row][12] + "</td>"
            // m_html += "<td>" + format_money(m_list[i_row][7]) + "</td>"
            // m_html += "<td>" + format_money(m_list[i_row][6]) + "</td>"
            // m_html += "<td>" + format_money(m_list[i_row][8]) + "</td>"
            // m_html += "<td>" + format_money(m_list[i_row][11]) + "</td>"
            // m_html += "<td>" + m_list[i_row][14] + "</td>"
            // m_html += "<td>" + format_money(m_list[i_row][13]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = "<caption align=\"top\">" + caption + "-" + m_list.length + "</caption>"
        //m_list 为空则清空表格
        if (m_list.length == 0) {
            tb.innerHTML = caption + m_th + ''
        } else
            tb.innerHTML = caption + m_th + m_html
    }


    function set_table2(data, id, caption) {
        all_theme = [];
        var m_html = ""
        var m_th = "<tr class=\"cur\">\
            <th style=\"width:68px\">股票名称</th>\
            <th style=\"width:68px\">状态</th>\
            <th style=\"width:180px\">板块</th>\
            <th style=\"width:40px\">涨幅%</th>\
            </tr>"
        // <th>成交额</th>\
        var m_list = data['data']
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else
                m_html += "<tr class=\"cur\">"
            if (m_list[i_row][16] == 1) {
                m_html += "<td class=\"gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            } else {
                m_html += "<td class=\"td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>"
            }
            m_html += "<td>" + m_list[i_row][15] + "</td>"
            m_html += "<td>" + m_list[i_row][6] + "</td>"
            if (m_list[i_row][5] < 0) {
                m_html += "<td class=\"gbnews gre\">" + m_list[i_row][5] + "</td>" //设置涨幅的颜色
            } else {
                m_html += "<td class=\"red\">" + m_list[i_row][5] + "</td>"
            }

            // m_html += "<td>" + format_money(m_list[i_row][10]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = "<caption align=\"top\">" + caption + "-" + m_list.length + "</caption>"
        //m_list 为空则清空表格
        if (m_list.length == 0) {
            tb.innerHTML = caption + m_th + ''
        } else
            tb.innerHTML = caption + m_th + m_html
    }

    function set_table2_history(data, id, caption, limit) {
        all_theme = [];
        var m_html = ""
        var m_th = "<tr class=\"cur\">\
            <th style=\"width:80px\">股票名称</th>\
            <th style=\"width:72px\">状态</th>\
            <th style=\"width:180px\">板块</th>\
            <th style=\"width:40px\" >昨日%</th>\
            <th style=\"width:40px\">实时%</th>\
            </tr>"
        // <th>成交额</th>\
        var m_list = data['data']
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else {
                m_html += "<tr class=\"cur\">"
            }
            if (m_list[i_row][16] == 1) {
                m_html += "<td class=\"gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            } else {
                m_html += "<td class=\"td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>"
            }
            m_html += "<td>" + m_list[i_row][15] + "</td>"
            m_html += "<td>" + m_list[i_row][6] + "</td>"
            // m_html += "<td>" + limit[m_list[i_row][0]]["涨跌(%)"] + "</td>"
            if (m_list[i_row][5] < 0) {
                m_html += "<td class=\"gbnews gre\">" + m_list[i_row][5] + "</td>" //设置涨幅的颜色
            } else {
                m_html += "<td class=\"red\">" + m_list[i_row][5] + "</td>"
            }
            if (limit[m_list[i_row][0]]["涨跌(%)"] < 0) {
                m_html += "<td class=\"gbnews gre\">" + limit[m_list[i_row][0]]["涨跌(%)"] + "</td>" //设置股票名称的颜色
            } else {
                m_html += "<td class=\"red\">" + limit[m_list[i_row][0]]["涨跌(%)"] + "</td>"
            }
            // m_html += "<td>" + format_money(m_list[i_row][10]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = "<caption align=\"top\">" + caption + "-" + m_list.length + "</caption>"
        //m_list 为空则清空表格
        if (m_list.length == 0) {
            tb.innerHTML = caption + m_th + ''
        } else
            tb.innerHTML = caption + m_th + m_html
    }
    // 炸板表格
    function set_table_broke(data) {
        all_theme = [];
        var m_html = ""
        var m_th = "<tr class=\"cur\">\
            <th>股票名称</th>\
            <th>涨幅</th>\
            <th>板块</th>\
            <th>成交额</th>\
            </tr>"
        var m_list = data
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else
                m_html += "<tr class=\"cur\">"

            m_html += "<td>" + m_list[i_row][1] + "</td>"
            // 设置颜色
            if (m_list[i_row][4] > 0) {
                m_html += "<td class=\"red\">" + m_list[i_row][4] + "</td>"
            } else
                m_html += "<td class=\"gre\">" + m_list[i_row][4] + "</td>"
            m_html += "<td>" + m_list[i_row][11] + "</td>"
            m_html += "<td>" + format_money(m_list[i_row][13]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById("broke"); //获取表格的dom节点
        var caption = "<caption align=\"top\">炸板-" + m_list.length + "</caption>"
        tb.innerHTML = caption + m_th + m_html
    }

    // 历史炸板表格
    function set_table_broke_history(data, id, caption, limit) {
        all_theme = [];
        var m_html = ""
        var m_th = "<tr class=\"cur\">\
            <th style=\"width:80px\">股票名称</th>\
            <th style=\"width:72px\">涨幅</th>\
            <th style=\"width:180px\">板块</th>\
            <th style=\"width:60px\" >成交额</th>\
            <th style=\"width:40px\">实时%</th>\
            </tr>"
        // <th>成交额</th>\
        var m_list = data['data']
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else {
                m_html += "<tr class=\"cur\">"
            }
            m_html += "<td>" + m_list[i_row][1] + "</td>"//股票名称
            // 设置涨幅颜色
            if (m_list[i_row][4] > 0) {
                m_html += "<td class=\"red\">" + m_list[i_row][4] + "</td>"
            } else
                m_html += "<td class=\"gre\">" + m_list[i_row][4] + "</td>"
            m_html += "<td>" + m_list[i_row][11] + "</td>"
            m_html += "<td>" + format_money(m_list[i_row][13]) + "</td>"
            // m_html += "<td>" + limit[m_list[i_row][0]]["涨跌(%)"] + "</td>"

            if (limit[m_list[i_row][0]]["涨跌(%)"] < 0) {
                m_html += "<td class=\"gbnews gre\">" + limit[m_list[i_row][0]]["涨跌(%)"] + "</td>" //设置股票名称的颜色
            } else {
                m_html += "<td class=\"red\">" + limit[m_list[i_row][0]]["涨跌(%)"] + "</td>"
            }
            // m_html += "<td>" + format_money(m_list[i_row][10]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = "<caption align=\"top\">" + caption + "-" + m_list.length + "</caption>"
        //m_list 为空则清空表格
        if (m_list.length == 0) {
            tb.innerHTML = caption + m_th + ''
        } else
            tb.innerHTML = caption + m_th + m_html
    }

</script>

</html>